home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 2001 May / SGI Freeware 2001 May - Disc 1.iso / dist / fw_qt.idb / usr / freeware / include / qftp.h.z / qftp.h
C/C++ Source or Header  |  2001-04-12  |  3KB  |  106 lines

  1. /****************************************************************************
  2. ** $Id: qt/src/network/qftp.h   2.3.0   edited 2001-01-26 $
  3. **
  4. ** Definition of QFtp class.
  5. **
  6. ** Created : 970521
  7. **
  8. ** Copyright (C) 1992-2000 Trolltech AS.  All rights reserved.
  9. **
  10. ** This file is part of the network module of the Qt GUI Toolkit.
  11. **
  12. ** This file may be distributed under the terms of the Q Public License
  13. ** as defined by Trolltech AS of Norway and appearing in the file
  14. ** LICENSE.QPL included in the packaging of this file.
  15. **
  16. ** This file may be distributed and/or modified under the terms of the
  17. ** GNU General Public License version 2 as published by the Free Software
  18. ** Foundation and appearing in the file LICENSE.GPL included in the
  19. ** packaging of this file.
  20. **
  21. ** Licensees holding valid Qt Enterprise Edition licenses may use this
  22. ** file in accordance with the Qt Commercial License Agreement provided
  23. ** with the Software.
  24. **
  25. ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
  26. ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  27. **
  28. ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
  29. **   information about Qt Commercial License Agreements.
  30. ** See http://www.trolltech.com/qpl/ for QPL licensing information.
  31. ** See http://www.trolltech.com/gpl/ for GPL licensing information.
  32. **
  33. ** Contact info@trolltech.com if any conditions of this licensing are
  34. ** not clear to you.
  35. **
  36. **********************************************************************/
  37.  
  38. #ifndef QFTP_H
  39. #define QFTP_H
  40.  
  41. #ifndef QT_H
  42. #include "qsocket.h"
  43. #include "qapplication.h"
  44. #include "qstring.h"
  45. #include "qstringlist.h"
  46.  
  47. #include "qurlinfo.h"
  48. #include "qnetworkprotocol.h"
  49. #endif // QT_H
  50.  
  51. #ifndef QT_NO_NETWORKPROTOCOL_FTP
  52.  
  53. class Q_EXPORT QFtp : public QNetworkProtocol
  54. {
  55.     Q_OBJECT
  56.  
  57. public:
  58.     QFtp();
  59.     virtual ~QFtp();
  60.     virtual int supportedOperations() const;
  61.  
  62. protected:
  63.     void parseDir( const QString &buffer, QUrlInfo &info );
  64.     virtual void operationListChildren( QNetworkOperation *op );
  65.     virtual void operationMkDir( QNetworkOperation *op );
  66.     virtual void operationRemove( QNetworkOperation *op );
  67.     virtual void operationRename( QNetworkOperation *op );
  68.     virtual void operationGet( QNetworkOperation *op );
  69.     virtual void operationPut( QNetworkOperation *op );
  70.  
  71.     QSocket *commandSocket, *dataSocket;
  72.     bool connectionReady, passiveMode;
  73.     int getTotalSize, getDoneSize;
  74.     bool startGetOnFail;
  75.     int putToWrite, putWritten;
  76.     int putOffset; // not in use
  77.     bool errorInListChildren;
  78.  
  79. private:
  80.     bool checkConnection( QNetworkOperation *op );
  81.     void close();
  82.     void reinitCommandSocket();
  83.     void okButTryLater( int code, const QCString &data );
  84.     void okGoOn( int code, const QCString &data );
  85.     void okButNeedMoreInfo( int code, const QCString &data );
  86.     void errorForNow( int code, const QCString &data );
  87.     void errorForgetIt( int code, const QCString &data );
  88.  
  89. protected slots:
  90.     void hostFound();
  91.     void connected();
  92.     void closed();
  93.     void readyRead();
  94.     void dataHostFound();
  95.     void dataConnected();
  96.     void dataClosed();
  97.     void dataReadyRead();
  98.     void dataBytesWritten( int nbytes );
  99.     void error( int );
  100.  
  101. };
  102.  
  103. #endif // QT_NO_NETWORKPROTOCOL_FTP
  104.  
  105. #endif // QFTP_H
  106.